package com.netease.financial.module.information;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.netease.financial.common.constant.Constants;
import com.netease.financial.common.util.preferences.BadgePreferencesHelper;
import com.netease.financial.internal.di.components.MainComponent;
import com.netease.financial.module.web.WebViewTabFragment;

import cn.bingoogolapple.badgeview.BGABadgeable;

public class InformationFragment extends WebViewTabFragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initialize();
    }

    private void initialize() {
        getComponent(MainComponent.class).inject(this);
    }

    @Override
    public String getInitialPageUrl() {
        return Constants.getInformationUrl();
    }

    @Override
    public boolean isTabBadgeShouldShow() {
        return BadgePreferencesHelper.isInformationTabBadgeShouldShow();
    }

    @Override
    public void showBadge(BGABadgeable badgeView) {
        badgeView.showCirclePointBadge();
    }

}
